package cz.muni.fi.pa165.sme.web.panels;

import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

/**
 * An abstract class represents panel with link for edit action.
 *
 * @author hromada
 */
public abstract class EditPanel extends Panel {

	public EditPanel(final String id) {
		this(id, null);
	}

	public EditPanel(final String id, final IModel<?> model) {
		super(id, model);
		add(new Link<Void>("editLink") {

			@Override
			public void onClick() {
				onEdit();
			}

		});
	}

	/**
	 * Executes edit action.
	 */
	public abstract void onEdit();

}
